package co.fitstart.mobile.entity;

import org.apache.commons.lang3.StringUtils;

/**
 * 
 * @author downpour
 */
public class UserContext {
    
    private String openid;
    
    private String accountId;
    
    private String mobile;
    
    /**
     * The default constructor
     */
    public UserContext() {
        
    }
    
    /**
     * 
     * @param openid
     * @return
     */
    public UserContext openid(String openid) {
        this.openid = openid;
        return this;
    }
    
    /**
     * 
     * @param mobile
     * @return
     */
    public UserContext mobile(String mobile) {
        this.mobile = mobile;
        return this;
    }
    
    public UserContext accountId(String accountId) {
        this.accountId = accountId;
        return this;
    }

    /**
     * The client is micro messenger or not
     * 
     * @return
     */
    public boolean isMicroMessenger() {
        return StringUtils.isNoneBlank(this.openid) && StringUtils.isNotEmpty(this.openid);
    }

    /**
     * @return the openid
     */
    public String getOpenid() {
        return openid;
    }

    /**
     * @return the mobile
     */
    public String getMobile() {
        return mobile;
    }
    
    /**
     * @return the accountId
     */
    public String getAccountId() {
        return accountId;
    }

}
